/**
 * Copyright (C)  Gadglet .
 *
 * This file is part of Gadglet
 *
 * Gadglet is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gadglet is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Gadglet. If not, see <http://www.gnu.org/licenses/>.
 */

package com.gadglet.gadgets.phoneBook.client;

import com.google.gwt.json.client.JSONObject;

class PhoneNumber{
	
	private JSONObject numEntry = null;
	PhoneNumber (JSONObject numEntry)
	{
		this.numEntry = numEntry;
	}
		

	public String getNumberType() {
		
		String pNumberType = "";
		try {
			
			String tmp = numEntry.get("rel").isString().stringValue();
			pNumberType =tmp.substring(tmp.indexOf("#")+1);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			
		}
		
		return pNumberType;
	}

	public String getNumber() {
		String pNumber = "";
		
		try {
			pNumber = numEntry.get("$t").isString().stringValue();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			
		}
		
		return pNumber;
	}
}
